const express = require('express');
const router = express.Router();
const constants = require('../db/constants')

const zlMediaCtrl = require('../controller/v1/zlMediaRestful');

router.get('/', zlMediaCtrl.index);

/**
 * HOOK，给ZL回调使用
 */
router.get(constants.version + 'media/getServerConfig',        zlMediaCtrl.getServerConfig);
router.get(constants.version + 'media/rtp_list',               zlMediaCtrl.rtpList);

/**
 * @api {post} /media/listRecordFiles 获取录像列表
 * @apiDescription 获取录像列表
 * @apiName listRecordFiles
 * @apiParam {string} camera_id 拉流id
 * @apiParam {string} date 日期，如2023-01-22
 * @apiGroup 媒体管理
 * @apiVersion 1.0.0
 */
router.get(constants.version + 'media/listRecordFiles',        zlMediaCtrl.listRecordFiles);

/**
 * @api {post} /media/isRecording 是否在录像
 * @apiDescription 是否在录像
 * @apiName isRecording
 * @apiGroup 媒体管理
 * @apiVersion 1.0.0
 */
router.get(constants.version + 'media/isRecording',            zlMediaCtrl.isRecording);
router.get(constants.version + 'media/listStreams',            zlMediaCtrl.listStreams);
module.exports = router;
